Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use assertFailsWith instead of expected #5202

Conversation

riQQ
Copy link
Collaborator

@riQQ riQQ commented Aug 17, 2023

As promised in #5193 (comment)

Other than that, some classes use @Test(expected = <ExceptionClass>::class). Should this also be replaced?

Oh yeah, I'd like that! Not required for this PR to be merged, though. Never liked that API. I think they also corrected that awkward API in JUnit 5. (But if we migrate, we rather migrate fully to kotlin.test rather than Junit 5).
If you do that, consider whether it makes sense to group such test functions into one test function (i.e. they were only really in separate functions because of that API before).

I will do this in another PR.

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@westnordost westnordost merged commit 2ba74a9 into streetcomplete:master Aug 17, 2023
@riQQ riQQ deleted the test/use-assertFailsWith-instead-of-expected branch August 17, 2023 21:04
@riQQ riQQ mentioned this pull request Dec 20, 2023
@FloEdelmann

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

3 participants